<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <div class="houdunwang" data-content="后盾人"  data-color="red">houdunwang.com</div>
    <script>
        //单个单词
      
let div=document.querySelector(".houdunwang");
let content=div.dataset.content;
let color=div.dataset.color;
console.log(content,color);
//后盾人 red
  //改变dataset的值也会改变原来的值(原来方法或者这样都可以)
  div.dataset.content="唐玮";
// div.setAttribute("data-content","唐玮");
  console.log(div.dataset.content);//唐玮

//多个单词也可以
//data-title-color 就为 dataset.titleColor

    </script>
</body>
</html>